# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=py3-nest_asyncio
pkgver=1.6.0
pkgrel=2
pkgdesc="Asyncio patch to allow nested event loops"
url="https://github.com/erdewit/nest_asyncio"
arch="noarch"
license="BSD-2-Clause"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/erdewit/nest_asyncio/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/nest_asyncio-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b594bb2b245624032585af34540025bdc6b8224a6d59bd8ffcc5d5673d47c49736ac96cd20b5ca5ce311f8e9274df68560a4b2904273d4036f1560eeb74cfdf7  py3-nest_asyncio-1.6.0.tar.gz
"
